1: | app(nil,k) | → k | |
2: | app(l,nil) | → l | |
3: | app(cons(x,l),k) | → cons(x,app(l,k)) | |
4: | sum(cons(x,nil)) | → cons(x,nil) | |
5: | sum(cons(x,cons(y,l))) | → sum(cons(plus(x,y),l)) | |
6: | sum(app(l,cons(x,cons(y,k)))) | → sum(app(l,sum(cons(x,cons(y,k))))) | |
7: | plus(0,y) | → y | |
8: | plus(s(x),y) | → s(plus(x,y)) | |
9: | APP(cons(x,l),k) | → APP(l,k) | |
10: | SUM(cons(x,cons(y,l))) | → SUM(cons(plus(x,y),l)) | |
11: | SUM(cons(x,cons(y,l))) | → PLUS(x,y) | |
12: | SUM(app(l,cons(x,cons(y,k)))) | → SUM(app(l,sum(cons(x,cons(y,k))))) | |
13: | SUM(app(l,cons(x,cons(y,k)))) | → APP(l,sum(cons(x,cons(y,k)))) | |
14: | SUM(app(l,cons(x,cons(y,k)))) | → SUM(cons(x,cons(y,k))) | |
15: | PLUS(s(x),y) | → PLUS(x,y) | |